﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.UI.WebControls;
using CommonHelper.Server;
using WeiXinGeneralApi.Models;

namespace WeiXinGeneralApi.Controllers
{
    public class MenuController : Controller
    {
        //
        // GET: /Menu/

        public ActionResult Index()
        {
            return View();
        }

        [HttpGet]
        public ActionResult Create()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Create(MenuDto dto)
        {
            return Json("");
        }

        [HttpGet]
        public ActionResult Search()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Search(MenuDto dto)
        {
            var menu=MenuService.SearchMenu(dto.AppId,dto.AppSecret);
            return Content(menu);
        }

        [HttpGet]
        public ActionResult Delete()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Delete(MenuDto dto)
        {
            var menu = MenuService.Delete(dto.AppId,dto.AppSecret);
            return Json(menu);
        }
    }
}
